const app = {
    namespaced: true,
    state: {
        textVuex: '测试',
        arrayVuex: []
    },
    mutations: {
        SET_TESTVUEX: (state, myval) => {
            state.textVuex = myval
            sessionStorage.setItem('textVuex', myval)
        },
        SET_ARRAYVUEX: (state, myval) => {
            state.arrayVuex = [...[myval]];
        }
    },
    actions: {
        myTestVuex({ commit, state }, value) {
            return new Promise((resolve) => {
                commit('SET_TESTVUEX', value)
                resolve([...state.arrayVuex])
            })
        }
    }
}

export default app